package org.come.Jpanel;

import com.tool.image.ImageMixDeal;
import com.tool.role.RoleLingFa;
import com.tool.tcp.GetTcpPath;
import com.tool.tcp.Sprite;
import com.tool.tcp.SpriteFactory;
import com.tool.tcpimg.ChatBox;
import com.tool.tcpimg.UIUtils;
import com.tool.time.Limit;
import com.tool.time.TimerUtil;
import come.tool.Fighting.FightingManData;
import come.tool.FightingData.FBUtil;
import org.apache.commons.lang.math.NumberUtils;
import org.come.Frame.MsgJframe;
import org.come.Frame.ZhuFrame;
import org.come.bean.BabyResult;
import org.come.bean.ImgZoom;
import org.come.bean.Skill;
import org.come.bean.Talent;
import org.come.entity.Goodstable;
import org.come.model.Lingbao;
import org.come.until.*;

import javax.swing.*;
import java.awt.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 
 * @author Administrator
 * 
 */
public class MsgJapnel extends JPanel {
	// 描述框
	private ChatBox box;
	private Skill skill;
	// 展示的位置大小
	private int boxx;
	private int boxy;
	private int boxw;
	private int boxh;
	private long time = 0;

	public MsgJapnel() {
		// TODO Auto-generated constructor stub
		box = new ChatBox();
		box.setAlpha(0.6f);

		this.setLayout(null);
		this.setBackground(new Color(0, 0, 0, 0));
	}

	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		if (this.tx != null) {
			this.time += 20L;
			this.tx.updateToTime(this.time, 0);
			this.tx.draw(g, ScrenceUntil.Screen_x / 2, ScrenceUntil.Screen_y / 2);
			if ((long)this.tx.getTime() < this.time) {
				this.tx = null;
				FormsManagement.HideForm(46);
			}
		}
		else {
			final Graphics2D g2 = (Graphics2D)g.create(0, 0, this.boxw, this.boxh);
			this.box.paintSSS((Graphics)g2);
			g2.dispose();
		}

		if(pointFlag){
			g.drawImage(points.getImage(), 5, 5, points.getIconWidth(), points.getIconHeight(), this);
		}
	}
	public void SM3(Skill skill) {
		box.removemsg();
		String msg = skill.getRemark();
//		msg = Util.convert(msg);
		box.addText(msg, 320);
		boxw = 320;// 宽
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(), new Dimension(boxw, boxh));
		boxx = (int) goodx.getX();
		boxy = (int) goodx.getY();
		displaymsg();
	}
	/**
	 * 画出灵宝技能展示信息
	 *
	 * @return
	 */
	public void zsskill(String v, int x, int y) {
		box.removemsg();
		String[] vs = v.split("=");
		Skill skill = UserMessUntil.getskill1(vs[0]);
		box.addText("#W" + vs[0], 250);
		box.addText("#Y【组合技能】: " + vs[1] + "人合技", 250);
		if (skill.getSkilltype().equals("0")) {
			box.addText("#Y【组合类型】: 攻击类", 250);
		} else if (skill.getSkilltype().equals("1")) {
			box.addText("#Y【组合类型】: 辅助类", 250);
		} else {
			box.addText("#Y【组合类型】: 落宝类", 250);
		}
		String[] msgs = skill.getRemark().split("\\|");
		int lvl = Integer.parseInt(vs[1]);
		int id = Integer.parseInt(skill.getSkillid());
		for (int i = 0; i < msgs.length; i++) {
			if (msgs[i].equals("目标数")) {
				box.addText("#Y【目标数】: " + getsum(id, lvl), 250);
			} else if (msgs[i].equals("持续回合数")) {
				box.addText("#Y【持续回合数】: " + getchixu(id, lvl), 250);
			} else {
				box.addText(msgs[i], 250);
			}
		}
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2;
		boxy = y - boxh - 5;
		displaymsg();

	}
	public void vips1(final String msg, final String colorStr) {
		this.box.removemsg();
		this.boxw = msg.length() * 14 + 10;
		this.box.addText("#c" + colorStr + msg, this.boxw, UIUtils.TEXT_FONT78);
		final Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(), new Dimension(this.boxw, this.boxh));
		this.boxx = (int)goodx.getX() - 25;
		this.boxy = (int)goodx.getY() + 20;
		this.displaymsg();
	}
	/** 获取灵技能个数 */
	public int getsum(int id, int lvl) {
		if ((id >= 3001 && id <= 3009) || id == 3023 || id == 3027) {
			return getsum2(lvl);
		} else if (id == 3013 || id == 3014 || id == 3015) {
			return getsum3(lvl);
		} else if (id >= 3016 && id <= 3020) {
			return getsum4(lvl);
		} else if (id == 3028 || id == 3029 || id == 3030) {
			return lvl - 3;
		} else {
			return lvl;
		}
	}

	public int getsum2(int sum) {
		if (sum <= 3)
			return sum;
		else
			return (sum << 1) - 3;
	}

	public int getsum3(int sum) {
		return (sum << 1) - 1;
	}

	public int getsum4(int sum) {
		if (sum >= 5)
			return 10;
		else
			return (sum << 1) - 1;
	}

	/** 获取灵技能持续 */
	public int getchixu(int id, int lvl) {
		if (id == 3009) {
			return 1;
		} else if (id == 3010 || id == 3026 || id == 3022) {
			return 2;
		} else if (id >= 3016 && id <= 3019) {
			if (lvl > 4)
				return 3;
			else
				return 2;
		} else if (id == 3025 || id == 3023) {
			return 3;
		} else if (id == 3028) {
			return lvl - 3;
		} else if (id == 3029) {
			if (lvl > 3)
				return 2;
			else
				return 1;
		} else {
			return lvl;
		}
	}

	/**
	 * 画出符石展示信息
	 */
	public void zsfs(Goodstable goodstable, int x, int y) {
		box.removemsg();
		box.addText("#W " + goodstable.getGoodsname(), 250);
		String[] v = goodstable.getValue().split("\\|");
		for (int i = 0; i < v.length; i++) {
			box.addText("#Y " + v[i].split("=")[0] + " " + v[i].split("=")[1], 250);
		}
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2;
		boxy = y - boxh - 5;
		displaymsg();
	}

	/** 画出属性卡展示信息 */
	public void zssxk(Limit limit, int x, int y) {
		if (limit.getType().equals("SVIP")) {
			zsVIP(limit, x, y);
			return;
		}
		if (limit.getType().equals("超级六脉化神丸_月")||limit.getType().equals("超级玉枢返虚丸_月")) {
			zsVIP1(limit, x, y);
			return;
		}
//		if (limit.getType().equals("加抗型")||limit.getType().equals("增益型")){//等于或者不等于都是显示分钟
//			String time = "#G剩余的时间" + "#Y" + TimerUtil.fenzhong(limit.getTime()) + "#G分钟";
//			box.addText("#Y " + limit.getName() + "   " + time, 240);
//		}
//		if (limit.getType().equals("强法型")){//等于或者不等于都是显示分钟
//			String time = "#G剩余的时间" + "#Y" + TimerUtil.fenzhong(limit.getTime()) + "#G分钟";
//			box.addText("#Y " + limit.getName() + "   " + time, 240);
//		}
		box.removemsg();

		if (limit.getType().equals("变身卡")||limit.getType().equals("摄妖香")||limit.getType().equals("强法型")||limit.getType().equals("加抗型")||limit.getType().equals("增益型")
				||limit.getType().equals("童卡")||limit.getType().equals("六脉化神丸")||limit.getType().equals("玉枢返虚丸")||limit.getType().equals("枯荣丹")||limit.getType().equals("经验")
				||limit.getType().equals("回血符")||limit.getType().equals("回蓝符")){//等于或者不等于都是显示分钟
			String time = "#G剩余的时间" + "#Y" + TimerUtil.fenzhong(limit.getTime()) + "#G分钟";
			box.addText("#Y " + limit.getName() + "   " + time, 240);
		}
//		if (limit.getType().equals("变身卡")||limit.getType().equals("摄妖香")
//				||limit.getType().equals("童卡")||limit.getType().equals("六脉化神丸")||limit.getType().equals("玉枢返虚丸")||limit.getType().equals("枯荣丹")||limit.getType().equals("经验")
//				||limit.getType().equals("回血符")||limit.getType().equals("回蓝符")){//等于或者不等于都是显示分钟
//			String time = "#G剩余的时间" + "#Y" + TimerUtil.fenzhong(limit.getTime()) + "#G分钟";
//			box.addText("#Y " + limit.getName() + "   " + time, 240);
//		}
		else if (limit.getType().equals("VIP")){
			String timex = "#G剩余" + "#Y" + TimerUtil.residueDay(limit.getTime()) + "#G天";
			box.addText("#Y  " + limit.getName() + "   " + timex, 220);
		}else if (limit.getType().equals("至尊特权") ||limit.getType().equals("钻石特权")){
			String timex = "#G剩余" + "#Y" + TimerUtil.residueDay(limit.getTime()) + "#G天";
			box.addText("#Y  " + limit.getName() + "   " + timex, 220);
		}
		else {
			box.addText("#Y  " + limit.getName(), 250);
		}
		String v = limit.getValue();
		if (v != null && !v.equals("")) {
			String[] vs = v.split("\\|");
			for (int i = 0; i < vs.length; i++) {
				String[] vss = vs[i].split("=");
				if (vss.length == 2) {
					if (!vss[0].equals("标签") && !vss[0].equals("值") && !vss[0].equals("皮肤") && !vss[0].equals("方向")
							&& !vss[0].equals("变身卡类") && !vss[0].equals("lvl") && !vss[0].equals("刮奖")
							&& !vss[0].equals("卡类")) {
						box.addText(
								"#W  " + vss[0] + " " + GoodsMsgJpanel.zffh(vss[1]) + GoodsMsgJpanel.tianjia(vss[0]),
								250);
					}
				} else if (vss.length == 1) {
					box.addText("#W  " + vss[0], 250);
				}
			}
		}
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx =  ScrenceUntil.Screen_x - 260;
		boxy = y + 50;
		displaymsg();
	}
	public void zsVIP1(Limit limit, int x, int y) {
		box.removemsg();
		String timex = "#G剩余" + "#Y" + TimerUtil.residueDay(limit.getTime()) + "#G天";
		box.addText("#Y  " + limit.getName() + "   " + timex, 220);
		box.addText("#W  战后结束后回复满召唤兽血量#r#W  战后结束后回复满角色血量", 250);
		String v = limit.getValue();
		if (v != null && !v.equals("")) {
			String[] vs = v.split("\\|");
			for (int i = 0; i < vs.length; i++) {
				String[] vss = vs[i].split("=");
				if (vss.length == 2) {
					if (!vss[0].equals("标签") && !vss[0].equals("值") && !vss[0].equals("皮肤") && !vss[0].equals("方向")
							&& !vss[0].equals("变身卡类") && !vss[0].equals("lvl") && !vss[0].equals("刮奖")
							&& !vss[0].equals("卡类")) {
						box.addText(
								"#W  " + vss[0] + " " + GoodsMsgJpanel.zffh(vss[1]) + GoodsMsgJpanel.tianjia(vss[0]),
								250);
					}
				} else if (vss.length == 1) {
					box.addText("#W  " + vss[0], 250);
				}
			}
		}
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx =  ScrenceUntil.Screen_x - 260;
		boxy = y + 50;
		displaymsg();
	}
	/** VIP展示 */
	public void zsVIP(Limit limit, int x, int y) {
		box.removemsg();
		box.addText("#Y  " + limit.getName(), 250);
		box.addText("#Y  以下加成只在PVE有效", 250);
		String v = limit.getValue();
		if (v != null && !v.equals("")) {
			String[] vs = v.split("\\|");
			for (int i = 0; i < vs.length; i++) {
				String[] vss = vs[i].split("=");
				if (vss.length == 2) {
					if (!vss[0].equals("标签") && !vss[0].equals("值") && !vss[0].equals("皮肤") && !vss[0].equals("方向")
							&& !vss[0].equals("变身卡类") && !vss[0].equals("lvl") && !vss[0].equals("刮奖")
							&& !vss[0].equals("卡类")) {
						box.addText(
								"#W  " + vss[0] + " " + GoodsMsgJpanel.zffh(vss[1]) + GoodsMsgJpanel.tianjia(vss[0]),
								250);
					}
				} else if (vss.length == 1) {
					box.addText("#W  " + vss[0], 250);
				}
			}
		}
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx =  ScrenceUntil.Screen_x - 260;
		boxy = y + 50;
		displaymsg();
	}

	/** 画出额外提示框 */
	public void ewts(String text, int x, int y) {
		box.removemsg();
		box.addText("#Y"+text+"", 136);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2;
		boxy = y - 70;
		displaymsg();

	}

	/** 画出额外提示框 */
	public void vip(String text, int x, int y) {
		box.removemsg();
		box.addText("#Y  " + text + "   ", 125);
		boxw = 320;// 宽
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(boxw, boxh));
		boxx = (int) goodx.getX() + 10;
		boxy = (int) goodx.getY();
		displaymsg();

	}

	public void showCdan(final String text, final int x, final int y) {
		pointFlag = false;
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#Y  " + text ,90,UIUtils.TEXT_FONT99);
		box.setForeground(UIUtils.COLOR_SIGN1);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x +25;
		boxy = ScrenceUntil.Screen_y - 45;
		displaymsg();
	}
	public void vips(String text, int x, int y) {
		pointFlag = false;
		box.removemsg();
		box.addText("#Y  " + text + "   ", 300);
		boxh = box.getHeight();
		boxw = box.getWidth();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(boxw, boxh));
		boxx = (int) goodx.getX() + 10;
		boxy = (int) goodx.getY() + 80;
		displaymsg();

	}

	public void showXFD(final String text, final int x, final int y) {
		pointFlag = false;
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#W  " + text ,80);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2;
		boxy = y + 40;
		displaymsg();

	}

	public void showXFD1(final String text, final int x, final int y) {
		pointFlag = false;
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#W  " + text ,90);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2;
		boxy = y + 40;
		displaymsg();

	}
	public void showXFD2(final String text, final int x, final int y) {
		box.removemsg();

		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#G  " + text ,160);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2;
		boxy = y - 35;
		displaymsg();
	}

	public void showXFD3(final String text, final int x, final int y) {
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#Y  " + text ,90);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2+50;
		boxy = y + 40;
		displaymsg();

	}

	public void showXFD4(final String text, final int x, final int y) {
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#Y  " + text ,65);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2+50;
		boxy = y + 40;
		displaymsg();

	}

	public void showXFD5(final String text, final int x, final int y) {
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#Y  " + text ,75);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2+50;
		boxy = y + 40;
		displaymsg();

	}

	public void showXFD6(final String text, final int x, final int y) {
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#Y  " + text ,75);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2+50;
		boxy = y + 70;
		displaymsg();

	}
	public void showchongzhi(String text,int x, int y) {
		pointFlag = false;
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#W  " + text ,130);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2;
		boxy = y + 20;
		displaymsg();

	}
	//TODO 召唤兽名字
	public void showzhaohuans(String msg, String colorStr) {
		pointFlag = false;
		this.box.removemsg();
		this.boxw = msg.length() * 12 + 10;
		this.box.addText(" #c" + colorStr + msg, this.boxw, UIUtils.TEXT_FONT78);
		this.boxh = this.box.getHeight();
		if (ImageMixDeal.userimg.getRoleShow().getFighting() != 0) {
			this.boxx = ScrenceUntil.Screen_x / 8;
			this.boxy = ScrenceUntil.Screen_y - 680;
		}
		else {
			this.boxx = ScrenceUntil.Screen_x - 400;
			this.boxy = ScrenceUntil.Screen_y - 680;
		}
		this.displaymsg();
	}

	//TODO 人物名字
	public void rolename(final String msg, final String colorStr) {
		pointFlag = false;
		this.box.removemsg();
		this.boxw = msg.length() * 12 + 10;
		this.box.addText(" #c" + colorStr + msg, this.boxw, UIUtils.TEXT_FONT78);
		this.boxh = this.box.getHeight();
		if (ImageMixDeal.userimg.getRoleShow().getFighting() != 0) {
			this.boxx = ScrenceUntil.Screen_x - 300;
			this.boxy = ScrenceUntil.Screen_y - 680;
		}
		else {
			this.boxx = ScrenceUntil.Screen_x - 300;
			this.boxy = ScrenceUntil.Screen_y - 680;
		}
		this.displaymsg();
	}

	public void showXFDS(String text,int x, int y) {
		pointFlag = false;
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#Y  " + text ,90,UIUtils.TEXT_FONT86);
		box.setForeground(UIUtils.COLOR_SIGN1);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x +25;
		boxy = y -25;
		displaymsg();

	}

	public void showXFDS1(String text,int x, int y) {
		pointFlag = false;
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#Y  " + text ,90,UIUtils.TEXT_FONT86);
		box.setForeground(UIUtils.COLOR_SIGN1);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = ScrenceUntil.Screen_x - 100;
		boxy = y -45;
		displaymsg();

	}

	public void showXFDS2(String text,int x, int y) {
		pointFlag = false;
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#Y  " + text ,90,UIUtils.TEXT_FONT86);
		box.setForeground(UIUtils.COLOR_SIGN1);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x +25;
		boxy = ScrenceUntil.Screen_y - 45;
		displaymsg();

	}

	public void showXFDS3(String text,int x, int y) {
		pointFlag = false;
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#Y  " + text ,90,UIUtils.TEXT_FONT86);
		box.setForeground(UIUtils.COLOR_SIGN1);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = ScrenceUntil.Screen_x - 100;
		boxy = ScrenceUntil.Screen_y - 45;
		displaymsg();

	}

	public void showXFDS22(String text,String text2,int x, int y) {
		pointFlag = false;
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#Y  " + text,90,UIUtils.TEXT_FONT86);
		box.addText("#Y  " + text2,90,UIUtils.TEXT_FONT86);
		box.setForeground(UIUtils.COLOR_SIGN1);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x +25;
		boxy = ScrenceUntil.Screen_y - 70;
		displaymsg();

	}
	public void showXFD25(final String text,String text2,String text3,String text4,String text5,String text6,  final int x, final int y) {
		pointFlag = false;
		box.removemsg();

		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#c  " + text,280,UIUtils.TEXT_HY193);
		box.addText("#c-------------------" + text2,280,UIUtils.TEXT_FONT7);
		box.addText("#Y  " + text3,280,UIUtils.TEXT_FONT);
		box.addText("#c  " + text4,280,UIUtils.TEXT_FONT);
		box.addText("#c  " + text5,280,UIUtils.TEXT_FONT);
		box.addText("#cEE2C2C  需要总心意点为:" + text6,280,UIUtils.TEXT_FONT);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2;
		boxy = y - 35;
		displaymsg();
	}
	public void showXFD26(final String text,String text2,String text3,String text4,String text5,String text6,  final int x, final int y) {
		pointFlag = false;
		box.removemsg();

		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#c  " + text,280,UIUtils.TEXT_HY193);
		box.addText("#c-------------------" + text2,280,UIUtils.TEXT_FONT7);
		box.addText("#Y  " + text3,280,UIUtils.TEXT_FONT);
		box.addText("#c  " + text4,280,UIUtils.TEXT_FONT);
		box.addText("#c  " + text5,280,UIUtils.TEXT_FONT);
		box.addText("#cEE2C2C  注意：清理的缓存是所有程序临时文件" + text6,280,UIUtils.TEXT_FONT);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2;
		boxy = y - 35;
		displaymsg();
	}

	public void showSZJ(String text,int x, int y) {
		pointFlag = false;
		box.removemsg();
		//box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT);
		box.addText("#W   " + text ,70);
		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2;
		boxy = y - 35;
		displaymsg();

	}


	/** 画出宝石炼化强化属性展示信息 */
	public void zsGemIntensify(int lvl, int x, int y) {
		pointFlag = false;
		box.removemsg();
		StringBuffer buffer = new StringBuffer();
		buffer.append("#Y");
		buffer.append("五灵共鸣:");
		buffer.append(lvl);
		buffer.append("级");
		box.addText(buffer.toString(), 200);
		buffer.setLength(0);
		buffer.append("#W四抗上限 +");
		buffer.append(String.format("%.2f", 0.4 * lvl));
		box.addText(buffer.toString(), 200);
		buffer.setLength(0);
		buffer.append("#W装备抗性上限 +");
		buffer.append(String.format("%.2f", 1.5 * lvl));
		box.addText(buffer.toString(), 200);
		buffer.setLength(0);
		buffer.append("#WHP +");
		buffer.append(2000 * lvl);
		box.addText(buffer.toString(), 200);
		buffer.setLength(0);
		buffer.append("#WMP +");
		buffer.append(1000 * lvl);
		box.addText(buffer.toString(), 200);

		if (lvl >= 12) {
			buffer.setLength(0);
			buffer.append("#c00F5FF气贯长虹:");
			box.addText(buffer.toString(), 200);
			buffer.setLength(0);
			buffer.append("#c00F5FF涅槃重生,破茧成蝶");
			box.addText(buffer.toString(), 200);
			buffer.setLength(0);
			buffer.append("#c00F5FF气贯长虹,笑傲江湖");
			box.addText(buffer.toString(), 200);
		}

		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2;
		boxy = y + 20;
		displaymsg();
	}

	private Sprite tx;

	/**
	 * 添加特效显示
	 */
	public void texiao(String type) {
		if (tx != null) {
			return;
		}
		Sprite mouse = SpriteFactory.Prepare(GetTcpPath.getMouseTcp(type));
		if (mouse != null) {
			time = 0;
			tx = mouse;
			boxw = ScrenceUntil.Screen_x;
			boxh = ScrenceUntil.Screen_y;
			boxx = 0;
			boxy = 0;
			displaymsg();
		}
	}

	/**
	 * 天资展示 0是普通 1是强化 p表示位置
	 */
	public void talent(Integer id, int lvl, int type, String outcome, int p) {
		Talent talent = UserMessUntil.getTalent(id);
		if (talent == null)
			return;
		if (id <= 3 && type == 1)
			return;
		box.removemsg();
		box.addText(gettalentname(talent.getTalentName(), type == 1 ? lvl : 0), 310);
		if (type == 0) {
			String msg = talent.getText();
			msg = msg.replace("{触发几率}", lvl * talent.getTouch() + "%");
			msg = msg.replace("{要求}", getdemand(talent.getDemand(), lvl));
			box.addText(msg, 310);
		} else {
			getvalue(talent, lvl, type, outcome, p);
		}
		boxw = 320;
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(boxw, boxh));
		boxx = (int) goodx.getX();
		boxy = (int) goodx.getY();
		displaymsg();
	}

	/**
	 * 获取名称
	 */
	public String gettalentname(String name, int lvl) {
		if (lvl == 0)
			return "#Y " + name;
		StringBuffer buffer = new StringBuffer();
		buffer.append("#Y 强化");
		buffer.append(name);
		buffer.append(" ");
		buffer.append(lvl);
		buffer.append("级");
		return buffer.toString();
	}

	/**
	 * 要求生成
	 */
	public String getdemand(String demand, int lvl) {
		if (lvl >= 9)
			return "天资已达到最高境界,不可强化";
		if (demand == null || demand.equals(""))
			return "";
		String[] v = demand.split("\\|");
		StringBuffer buffer = new StringBuffer();
		for (int i = 0; i < v.length; i++) {
			buffer.append(" ");
			String[] vs = v[i].split("=");
			buffer.append(vs[0]);
			buffer.append(" >= ");
			buffer.append(vs[1]);
		}

		buffer.append(" ,达到要求后可以继续强化有几率成功");
		return buffer.toString();
	}

	/*
	 * 强化描述生成
	 */
	public void getvalue(Talent talent, int lvl, int type, String outcome, int weizhi) {
		String[] v = talent.getValue().split("\\|");
		if (v.length == 2) {
			v = v[1].split("=");
			StringBuffer buffer = new StringBuffer();
			buffer.append(" 发动");
			buffer.append(talent.getTalentName());
			buffer.append("时增加");
			buffer.append(v[0]);
			v = v[1].split("\\+");
			buffer.append(Double.parseDouble(v[0]) + Double.parseDouble(v[1]) * lvl);
			box.addText(buffer.toString(), 310);
		}
		if (lvl >= 10)
			box.addText("#G已经达到最高级别了", 310);
		else
			box.addText("#G可以通过点击技能格子消耗琼浆玉液来强化此技能,有几率成功", 310);

		if (outcome == null || outcome.equals("")) {
			box.addText("#G还未获取结局,不可强化此技能格子", 310);
			return;
		}
		BabyResult babyResult = UserMessUntil.getBabyResult(outcome);
		int camp = 0;
		if (weizhi == 0) {
			camp = babyResult.getQ1();
		} else if (weizhi == 1) {
			camp = babyResult.getQ2();
		} else if (weizhi == 2) {
			camp = babyResult.getQ3();
		}
		switch (camp) {
		case 0:
			box.addText("#G此技能格可强化天资:不可强化", 310);
			break;
		case 1:
			box.addText("#G此技能格可强化天资:可强化低级人族天资", 310);
			break;
		case 2:
			box.addText("#G此技能格可强化天资:可强化低级魔族天资", 310);
			break;
		case 3:
			box.addText("#G此技能格可强化天资:可强化低级仙族天资", 310);
			break;
		case 4:
			box.addText("#G此技能格可强化天资:可强化低级鬼族天资", 310);
			break;
		case 5:
			box.addText("#G此技能格可强化天资:可强化全部低级天资", 310);
			break;
		case 6:
			box.addText("#G此技能格可强化天资:可强化高级人族天资", 310);
			break;
		case 7:
			box.addText("#G此技能格可强化天资:可强化高级魔族天资", 310);
			break;
		case 8:
			box.addText("#G此技能格可强化天资:可强化高级仙族天资", 310);
			break;
		case 9:
			box.addText("#G此技能格可强化天资:可强化高级鬼族天资", 310);
			break;
		case 10:
			box.addText("#G此技能格可强化天资:可强化全部高级天资", 310);
			break;
		case 11:
			box.addText("#G此技能格可强化天资:可强化全部天资", 310);
			break;
		default:
			break;
		}

	}

	/** 活跃礼包展示 */
	public void TYC(String name, String msg) {
		box.removemsg();
		box.addText("#cf8fc70" + name, 310, UIUtils.TEXT_FONT5);
		box.addText(msg, 310, UIUtils.TEXT_FONT1);
		boxw = 320;// 宽
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(boxw, boxh));
		boxx = (int) goodx.getX()+20;
		boxy = (int) goodx.getY()-20;
		displaymsg();

	}

	/** 灵犀展示 */
	public void LX(String name, String msg) {
		box.removemsg();
		box.addText("#c82aeff" + name, 310, UIUtils.TEXT_HY88);
		box.addText(msg, 310, UIUtils.TEXT_FONT1);
		boxw = 320;// 宽
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(boxw, boxh));
		boxx = (int) goodx.getX() + 50;
		boxy = (int) goodx.getY()+80;
		displaymsg();

	}

	/** 经脉展示 */
	public void JM(String name, String value) {
		box.removemsg();
		box.addText("#c82aeff" + name, 310, UIUtils.TEXT_HY88);
		if (value == null || value == "") {
			box.addText("【未开启】 ", 310, UIUtils.TEXT_FONT1);
		} else {
			box.addText("属性加成:"+"#r" +"#c82aeff"+ value, 200, UIUtils.TEXT_FONT1);
		}
		boxw = box.getWidth();// 宽
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(boxw, boxh));
		boxx = (int) goodx.getX() + 30;
		boxy = (int) goodx.getY() + 120;
		displaymsg();
	}
	public void SM1(Skill skill) {
		box.removemsg();
		String msg = skill.getRemark();
		int id = Integer.parseInt(skill.getSkillid());
		if (id <= 22000 || id >= 23000) {
			return;
		}
		box.addText(msg, 320);
		boxw = 320;// 宽
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(), new Dimension(boxw, boxh));
		boxx = (int) goodx.getX();
		boxy = (int) goodx.getY();
		displaymsg();
	}
	public void SM2(Skill skill) {
		box.removemsg();
		String msg = skill.getRemark();
		int id = Integer.parseInt(skill.getSkillid());
		if (id < 23000 || id >= 23010) {
			return;
		}
		box.addText(msg, 320);
		boxw = 320;// 宽
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(), new Dimension(boxw, boxh));
		boxx = (int) goodx.getX();
		boxy = (int) goodx.getY();
		displaymsg();
	}
	/**
	 * 技能语句替换
	 *
	 * @param remark   //技能介绍语句
	 * @param skillAll //技能
	 * @return 技能介绍语句
	 */
	public static String skillMsgchange(String remark, Skill skillAll) {
		int id = Integer.parseInt(skillAll.getSkillid());
		if (id == 9412 || id == 9811) {// 公式三十二//公式三十//公式三
			remark = remark.replace("{公式三十二}",
					String.valueOf(Arith.add(Arith.add(
							Arith.mul(Double.valueOf(skillAll.getSkilllevel()), Double.valueOf(skillAll.getGrow())),
							Double.valueOf(skillAll.getValue())), 20)));
			remark = remark.replace("{公式三十}",
					String.valueOf(Arith.div(
							Arith.mul(Double.valueOf(skillAll.getSkilllevel()), Double.valueOf(skillAll.getGrow())),
							125)));
			remark = remark.replace("{公式三}",
					String.valueOf(Arith.mul(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()), 4), 1.5),
							Double.valueOf(skillAll.getSkilllevel()))));
		} else if (id == 9189) {// 公式三十一//公式三十//公式三
			remark = remark.replace("{公式三十一}",
					String.valueOf(Arith.sub(Arith.add(Double.valueOf(skillAll.getValue()), 50),
							Arith.mul(Double.valueOf(skillAll.getGrow()), Double.valueOf(skillAll.getSkilllevel())))));
			remark = remark.replace("{公式三十}",
					String.valueOf(Arith.div(
							Arith.mul(Double.valueOf(skillAll.getSkilllevel()), Double.valueOf(skillAll.getGrow())),
							125)));
			remark = remark.replace("{公式三}",
					String.valueOf(Arith.mul(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()), 4), 1.5),
							Double.valueOf(skillAll.getSkilllevel()))));
		} else if (id == 9382) {// 公式三十//公式三
			remark = remark.replace("{公式三十}",
					String.valueOf(Arith.div(
							Arith.mul(Double.valueOf(skillAll.getSkilllevel()), Double.valueOf(skillAll.getGrow())),
							125)));
			remark = remark.replace("{公式三}",
					String.valueOf(Arith.mul(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()), 4), 1.5),
							Double.valueOf(skillAll.getSkilllevel()))));
		} else if (id == 9372) {// 公式二十九
			remark = remark.replace("{公式二十九}",
					String.valueOf(Arith.sub(100,
							(Integer.parseInt(skillAll.getSkilllevel()) <= 2
									? Arith.mul(Double.valueOf(skillAll.getSkilllevel()),
											Arith.mul(Double.valueOf(skillAll.getGrow()), 10))
									: Arith.add(10, Arith.mul(Double.valueOf(skillAll.getSkilllevel()), 5))))));

		} else if (id == 9370) {// 公式二十八//公式二十七
			remark = remark.replace("{公式二十八}",
					String.valueOf(Arith.add(
							Arith.mul(Arith.mul(Double.valueOf(skillAll.getGrow()), 3000),
									Double.valueOf(skillAll.getSkilllevel())),
							Arith.mul(Double.valueOf(skillAll.getValue()), 1500))));
			remark = remark.replace("{公式二十七}", String.valueOf(Arith.mul(Double.valueOf(skillAll.getGrow()),
					Arith.mul(Double.valueOf(skillAll.getSkilllevel()), 3000))));

		} else if (id == 9365) {// 公式二十六
			remark = remark.replace("{公式二十六}", String.valueOf(Arith.add(Double.valueOf(skillAll.getValue()), Arith
					.mul(Double.valueOf(skillAll.getGrow()), Arith.mul(5, Double.valueOf(skillAll.getSkilllevel()))))));
		} else if (id == 9352) {// 公式二十五//公式八
			remark = remark.replace("{公式二十五}",
					String.valueOf(Arith.add(25, Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()), 2),
							Arith.mul(5, Double.valueOf(skillAll.getSkilllevel()))))));
			remark = remark.replace("{公式八}", String.valueOf(Arith.add(Double.valueOf(skillAll.getValue()), Arith
					.div(Arith.mul(Double.valueOf(skillAll.getGrow()), Double.valueOf(skillAll.getSkilllevel())), 2))));
		} else if (id == 9328) {// 公式二十四//公式二十三
			remark = remark.replace("{公式二十四}",
					String.valueOf(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()), 4),
							Arith.mul(3, Double.valueOf(skillAll.getSkilllevel())))));
			remark = remark.replace("{公式二十三}", String.valueOf(Arith
					.mul(Arith.div(Double.valueOf(skillAll.getGrow()), 4), Double.valueOf(skillAll.getSkilllevel()))));

		} else if (id == 9326) {// 公式二十二
			remark = remark.replace("{公式二十二}",
					String.valueOf(Arith.add(Arith.mul(Arith.div(Double.valueOf(skillAll.getValue()), 2), 5),
							Arith.mul(Double.valueOf(skillAll.getGrow()), Double.valueOf(skillAll.getSkilllevel())))));
		} else if (id == 9307) {// 公式二十一////公式九
			remark = remark.replace("{公式二十一}",
					String.valueOf(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()), 5),
							Arith.mul(2, Double.valueOf(skillAll.getSkilllevel())))));
		} else if (id == 9369) {
			remark = remark.replace("{公式三十三}", String.valueOf(Arith.mul(2, Double.valueOf(skillAll.getSkilllevel()))));
		} else if (id == 9271) {// 公式十九
			remark = remark.replace("{公式十九}", String.valueOf(Arith.mul(Double.valueOf(skillAll.getSkilllevel()),
					Arith.mul(Double.valueOf(skillAll.getGrow()), 1000))));
		} else if (id == 9269) {// 公式十八//公式十七
			remark = remark.replace("{公式十八}",
					String.valueOf(Arith.add(Arith.mul(Double.valueOf(skillAll.getGrow()),
							Arith.mul((Integer.parseInt(skillAll.getSkilllevel()) <= 4
									? Double.valueOf(skillAll.getSkilllevel())
									: Arith.add(Double.valueOf(skillAll.getSkilllevel()), 1)), 500)),
							13000)));
			remark = remark.replace("{公式十七}", String.valueOf(Arith.add(Arith.mul(Double.valueOf(skillAll.getGrow()),
					Arith.mul(Double.valueOf(skillAll.getSkilllevel()), 250)), 10000)));
		} else if (id == 9251) {// 公式十六//公式十五
			remark = remark.replace("{公式十六}",
					String.valueOf(Arith.sub(Arith.add(Double.valueOf(skillAll.getValue()),
							(Integer.parseInt(skillAll.getSkilllevel()) > 3
									? Arith.sub(Double.valueOf(skillAll.getSkilllevel()), 3)
									: 0)),
							2)));
			remark = remark.replace("{公式十五}", String.valueOf(Arith.add(Double.valueOf(skillAll.getValue()),
					(Integer.parseInt(skillAll.getSkilllevel()) <= 3 ? Double.valueOf(skillAll.getSkilllevel()) : 3))));
		} else if (id == 9250) {// 公式十四
			remark = remark.replace("{公式十四}", String.valueOf(Arith
					.div(Arith.mul(Double.valueOf(skillAll.getGrow()), Double.valueOf(skillAll.getSkilllevel())), 6)));
		} else if (id == 9244) {// 公式十三
			remark = remark.replace("{公式十三}",
					String.valueOf(Arith.mul(
							Arith.mul(Double.valueOf(skillAll.getGrow()), Double.valueOf(skillAll.getSkilllevel())),
							800)));
		} else if (id == 9241) {// 公式十二
			remark = remark.replace("{公式十二}", String.valueOf(Arith.div(Arith.mul(Double.valueOf(skillAll.getGrow()),
					Arith.div(Double.valueOf(skillAll.getSkilllevel()), 4000)), 6)));
		} else if (id == 9231) {// 公式十一
			remark = remark.replace("{公式十一}", String.valueOf(Arith
					.mul(Arith.mul(Double.valueOf(skillAll.getGrow()), Double.valueOf(skillAll.getSkilllevel())), 10)));
		} else if (id == 9227 || id == 9287 || id == 9711) {// 公式九
			remark = remark.replace("{公式九}", String.valueOf(Arith.sub(Double.valueOf(skillAll.getValue()),
					Arith.mul(Double.valueOf(skillAll.getGrow()), Double.valueOf(skillAll.getSkilllevel())))));
		} else if (id == 9182) {// 公式八
			remark = remark.replace("{公式八}", String.valueOf(Arith.add(Double.valueOf(skillAll.getValue()), Arith
					.div(Arith.mul(Double.valueOf(skillAll.getGrow()), Double.valueOf(skillAll.getSkilllevel())), 2))));
		} else if (id == 9162 || id == 9265 || id == 9266) {// 公式七
			remark = remark.replace("{公式七}", String.valueOf(Arith.add(Double.valueOf(skillAll.getValue()), Arith
					.mul(Arith.mul(Double.valueOf(skillAll.getGrow()), Double.valueOf(skillAll.getSkilllevel())), 2))));
		} else if (id == 9152 || id == 9188) {// 公式六//公式五
			remark = remark.replace("{公式六}",
					String.valueOf(Arith.mul(
							Arith.mul(Double.valueOf(skillAll.getGrow()), Double.valueOf(skillAll.getSkilllevel())),
							500)));
			remark = remark.replace("{公式五}", String.valueOf(Arith
					.mul(Arith.mul(Double.valueOf(skillAll.getGrow()), Double.valueOf(skillAll.getSkilllevel())), 3)));
		} else if (id == 9171) {// 公式四
			remark = remark.replace("{公式四}", String
					.valueOf(Arith.add(Double.valueOf(skillAll.getSkilllevel()), Double.valueOf(skillAll.getGrow()))));
		} else if (id == 9125) {// 公式三
			remark = remark.replace("{公式三}",
					String.valueOf(Arith.mul(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()), 4), 1.5),
							Double.valueOf(skillAll.getSkilllevel()))));
		} else if (id == 9508) {// 公式三十四
			remark = remark.replace("{公式三十四}",
					String.valueOf(Arith.mul(Double.parseDouble(skillAll.getGrow()),
							Arith.mul(600, Arith.mul(Double.parseDouble(skillAll.getSkilllevel()),
									Double.parseDouble(skillAll.getValue()))))));
		} else if (id == 9510) {// 公式三十五
			remark = remark.replace("{公式三十五}",
					String.valueOf(Arith.add(60, Arith.mul(Double.parseDouble(skillAll.getGrow()),
							Arith.mul(Double.parseDouble(skillAll.getSkilllevel()), 5)))));
		} else if (id == 9511) {// 公式三十六//公式三十七
			remark = remark.replace("{公式三十六}", String.valueOf(Arith.mul(Double.parseDouble(skillAll.getGrow()),
					Arith.add(Double.parseDouble(skillAll.getSkilllevel()), 1))));
			remark = remark.replace("{公式三十七}",
					String.valueOf(Arith.mul(10000, Arith.mul(Double.parseDouble(skillAll.getGrow()),
							Arith.add(Double.parseDouble(skillAll.getSkilllevel()), 1)))));
		} else if (id == 9612) {// 公式三十八
			remark = remark.replace("{公式三十八}", String.valueOf((Double.parseDouble(skillAll.getSkilllevel()) <= 2 ? 1
					: Double.parseDouble(skillAll.getSkilllevel()) <= 4 ? 2 : 3)));
		} else if (id == 9191) {
			remark = remark.replace("{公式十}",
					String.valueOf(Arith.add(
							Arith.mul(Double.parseDouble(skillAll.getGrow()),
									Double.parseDouble(skillAll.getSkilllevel())),
							Arith.add(50, Double.parseDouble(skillAll.getValue())))));
		}
		remark = remark.replace("{公式一}", String.valueOf(Arith.add(Double.valueOf(skillAll.getValue()),
				Arith.mul(Double.valueOf(skillAll.getGrow()), Double.valueOf(skillAll.getSkilllevel())))));
		remark = remark.replace("{公式二}",
				String.valueOf(Arith.mul(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()), 4), 10),
						Double.valueOf(skillAll.getSkilllevel()))));
		remark = remark.replace("{公式二十}", String.valueOf(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()), 2),
				Arith.mul(5, Double.valueOf(skillAll.getSkilllevel())))));

		return remark;
	}

	/** 技能显示框 */
	public void SM(Skill skill, double sld, int lvl) {
		box.removemsg();
		String msg = skill.getRemark();
		int id = Integer.parseInt(skill.getSkillid());
		if (id >= 1001 && id <= 1100) {
			int level = Integer.parseInt(skill.getSkilllevel());// 技能等级
			double sv = Double.parseDouble(skill.getGrow());// 技能成长
			double mv = Double.parseDouble(skill.getDielectric());// 耗蓝介质
			double value = Double.parseDouble(skill.getValue());// 介值
			String type = id <= 1005 ? "混乱" : id <= 1010 ? "封印" : id <= 1015 ? "昏睡" : id <= 1020 ? "中毒" : id <= 1025 ? "震慑" : id <= 1030 ? "力量"
						: id <= 1035 ? "抗性" : id <= 1040 ? "加速" : id <= 1045 ? "风" : id <= 1050 ? "雷" : id <= 1055 ? "水" : id <= 1060 ? "火"
						: id <= 1065 ? "鬼火" : id <= 1070 ? "三尸虫" : id <= 1075 ? "遗忘" : id <= 1080 ? "smmh" : id <= 1085 ? "霹雳" : id <= 1090
							? "沧波" : id <= 1095 ? "甘霖" : "扶摇";

			msg = msg.replace("|个数|", FBUtil.geshu(level, (int) sld, type) + "");
			if (id <= 1015 || (id >= 1071 && id <= 1075)) {
				BigDecimal skillhitrate = new BigDecimal(value
						+ sv * new BigDecimal(Math.pow(sld, 0.3)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
				msg = msg.replace("|几率|", skillhitrate.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
				msg = msg.replace("|回合|", "7");
			} else if (id <= 1020) {
				// 命中概率
				BigDecimal skillhitrate = new BigDecimal(
						((double) ((int) ((value + sld * sv / 1000) * 1000)) / 15) * 17);
				msg = msg.replace("|伤害|", level > 3 ? "15" : level > 1 ? "12.5" : "10");
				msg = msg.replace("|几率|", skillhitrate.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
				msg = msg.replace("|回合|", "3");
			} else if (id <= 1040 || (id >= 1076 && id <= 1080)) {
				BigDecimal skillhitrate = new BigDecimal((double) ((int) ((value + sld * sv / 1000) * 1000)) / 10);
				msg = msg.replace("|回合|", "7");
				msg = msg.replace("|伤害|", skillhitrate.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
			} else if (id <= 1065 || id >= 1081) {
				BigDecimal skillhitrate = new BigDecimal(value + sv * Math.pow(sld, 0.4) * 1.75 * lvl);
				msg = msg.replace("|伤害|", skillhitrate.intValue() + "");
			} else if (id <= 1070) {
				msg = msg.replace("|伤害|", (int) ((value * lvl + sld * sv / 1000) * 1000) + "");
				msg = msg.replace("|几率|", (int) (value * 100 + (int) (sld / 250)) + "");
			}
			msg = msg.replace("|蓝|", (int) (mv * ((sld / 25000) + 1)) + "");


		} else if (id >= 5001 && id <= 5015) {
			msg ="#c8A2BE2" + skill.getSkillname() +
				 "#r#Y【消耗怨气值】" + skill.getDielectric() + "#r#W" + msg;

			int born = ImageMixDeal.userimg.getRoleShow().getTurnAround();
			int lvl2 = AnalysisString.lvlint(ImageMixDeal.userimg.getRoleShow().getGrade());
			int bzlvl = RoleLingFa.getRoleLingFa().getFaPJ();
			Lingbao fabao = RoleLingFa.getRoleLingFa().getFabaoByName(skill.getSkillname());
			if (fabao == null) {
				return;
			}
			int qv = RoleLingFa.getQv(fabao.getBaoquality());
			int blvl = fabao.getLingbaolvl().intValue();
			int pz = FBUtil.getFBlvl(born, lvl2, bzlvl, qv, blvl);
			double grow = 0;
			double value = 0;
			if (skill.getGrow() != null && !skill.getGrow().equals("")) {
				grow = Double.parseDouble(skill.getGrow());
			}
			if (skill.getValue() != null && !skill.getGrow().equals("")) {
				value = Double.parseDouble(skill.getValue());
			}
			String v1 = UserData.xiaoshu(value + pz * grow);// 概率
			String v2 = FBUtil.getFBcx(id, blvl) + "";// 回合
			String v3 = null;// 数值
			String v4 = FBUtil.getFBsum(id, blvl) + "";// 目标
			if (id == 4014) {
				v3 = (int) ((value + pz * grow) * 12500) + "";
			} else if (id == 4015) {
				v3 = UserData.xiaoshu((value + pz * grow) * 2 / 3);
			}
			msg = msg.replace("{概率}", "#R" + v1 + "#W");
			msg = msg.replace("{回合}", "#G" + v2 + "#W");
			if (v3 != null) {
				msg = msg.replace("{数值}", "#Y" + v3 + "#W");
			}
			msg = msg.replace("{目标}", "#Y" + v4 + "#W");

		} else if (id >= 9101 && id <= 9812) {
			msg = skillMsgchange(msg ,skill);
			msg ="#cFF8C00" + skill.getSkillname() +
					 "#r#Y【消耗怒气值】" + skill.getDielectric() + "#r#W" + msg;
		} else {
			return;
		}
		box.addText(msg, 320);
		boxw = 320;// 宽
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(boxw, boxh));
		boxx = (int) goodx.getX() + 10;
		boxy = (int) goodx.getY() + 80;
		displaymsg();
	}

	/** 血法上限展示 */
	public void showXF(String msg, String colorStr) {
		box.removemsg();
		boxw = msg.length() * 8 + 10;// 宽
		box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT78);
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(boxw, boxh));
		boxx = (int) goodx.getX() - 130;
		boxy = (int) goodx.getY() + 20;

		displaymsg();
	}

	public void showXF1(String msg, String colorStr) {
		box.removemsg();
		boxw = msg.length() * 8 + 10;// 宽
		box.addText(" #c" + colorStr + msg, boxw, UIUtils.TEXT_FONT78);
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(boxw, boxh));
		boxx = (int) goodx.getX() - 250;
		boxy = (int) goodx.getY() + 20;

		displaymsg();
	}


	public void showexe(String msg, String colorStr) {
		box.removemsg();
		boxw = msg.length() * 8 + 5;// 宽
		box.addText("#c" + colorStr + msg, boxw,UIUtils.TEXT_FONT);
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(boxw, boxh));
		boxx = (int) goodx.getX() + 15;
		boxy = (int) goodx.getY() +100;

		displaymsg();
	}

	/** 所有提示显示 */


	public static Map<String, String> lingxiState;

	static {
		lingxiState = new HashMap<String, String>();
		lingxiState.put("11006", "#G羊入虎口#Y");
		lingxiState.put("11007", "#G势不可挡#Y");
		lingxiState.put("11010", "#G化险为夷#Y");
		lingxiState.put("11012", "#G冲冠一怒#Y");
		lingxiState.put("11013", "#G唇亡齿寒#Y");
		lingxiState.put("11014", "#G怒不可遏#Y");
		lingxiState.put("11015", "#G晴天霹雳#Y");
		lingxiState.put("11017", "#G绝地反击#Y");
		lingxiState.put("11018", "#G火冒三丈#Y");
		lingxiState.put("11019", "#G攻守兼备#Y");
		lingxiState.put("11025", "#G惊涛拍岸#Y");
		lingxiState.put("11027", "#G八面玲珑#Y");
		lingxiState.put("11029", "#G风荷送香#Y");
		lingxiState.put("11031", "#G清风盈袖#Y");
		lingxiState.put("11032", "#G月共潮生#Y");
		lingxiState.put("11033", "#G节节高升#Y");
		lingxiState.put("11034", "#G步步为营#Y");
		lingxiState.put("11035", "#G待时而飞#Y");

		lingxiState.put("fbYsjl", "银索金铃");
		lingxiState.put("fbJjl", "将军令");
		lingxiState.put("fbDsc", "大势锤");
		lingxiState.put("fbQbllt", "七宝玲珑塔");
		lingxiState.put("fbHlz", "黑龙珠");
		lingxiState.put("fbYmgs", "幽冥鬼手");
		lingxiState.put("fbDsy", "大手印");
		lingxiState.put("fbJqb", "绝情鞭");
		lingxiState.put("fbQw", "情网");
		lingxiState.put("fbBld", "宝莲灯");
		lingxiState.put("fbJge", "金箍儿");
		lingxiState.put("fbFty", "番天印");
		lingxiState.put("fbJljs", "锦襕袈裟");
		lingxiState.put("fbBgz", "白骨爪");
		lingxiState.put("fbHd", "化蝶");

		lingxiState.put("7002", "飞花溅玉");
		lingxiState.put("7008", "百害不侵");
		lingxiState.put("7015", "饮鸩止渴");
		lingxiState.put("7026", "雪上加霜");
		lingxiState.put("7033", "蓄势待发");
		lingxiState.put("7034", "赤地千里");
		lingxiState.put("7035", "梦回前朝");
		lingxiState.put("9389", "流风回雪");
		lingxiState.put("1231", "天降脱兔");
		lingxiState.put("1232", "灵魂封魔");
		lingxiState.put("1866", "如虎添翼");
		lingxiState.put("1869", "夺魂索命");
		lingxiState.put("1873", "福禄双全");

		lingxiState.put("6018", "以戈止戈");
		lingxiState.put("6019", "寸步难行");
		lingxiState.put("6020", "玄妙神通");
		lingxiState.put("6021", "有的放矢");
		lingxiState.put("6022", "万古同悲");
		lingxiState.put("6023", "博观约取");
		lingxiState.put("6024", "生生不息");
		lingxiState.put("6025", "回头是岸");
		lingxiState.put("6026", "斩草除根");
		lingxiState.put("6027", "平湖秋月");
		lingxiState.put("6028", "夕阳箫鼓");
		lingxiState.put("6029", "回光返照");
		lingxiState.put("6030", "加强加速");
		lingxiState.put("6031", "水魔附身");
		lingxiState.put("6032", "加强三尸虫");
		lingxiState.put("6033", "时过境迁");
		lingxiState.put("6034", "忘乎所以");
		lingxiState.put("6035", "加强加防");
		lingxiState.put("6036", "加强魅惑");
		lingxiState.put("6037", "伤筋动骨");
		lingxiState.put("6038", "吹箫引凤");
		lingxiState.put("6039", "加强加攻");
		lingxiState.put("6040", "如鱼得水");
		lingxiState.put("6041", "追亡逐北");
		lingxiState.put("6042", "龙族震怒");
		lingxiState.put("1238", "归去来兮");
		lingxiState.put("1263", "金身不灭");
	}

	/** 战斗状态展示 */
	public void battleState(FightingManData manData) {
		List<String> state = manData.getStates();
		if (state.size() == 0 && manData.getAlpha() == 1) {
			return;
		}
		box.removemsg();
		StringBuilder s = new StringBuilder();
		for (String str : state) {
			if (s.length() == 0) {
				s.append("#Y");
			} else {
				s.append("、");
			}
			if (NumberUtils.isNumber(str) && lingxiState.containsKey(str)) {
				s.append(lingxiState.get(str));
			} else {
				s.append(str);
			}

		}
		if (manData.getAlpha() < 1) {
			if (s.length() == 0) {
				s.append("#Y隐身");
			} else {
				s.append("、隐身");
			}
		}
		box.addText(s.toString(), 150, UIUtils.TEXT_FONT);
		boxw = 150;// 宽
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(boxw, boxh));
		boxx = (int) goodx.getX() + 30;
		boxy = (int) goodx.getY();
		displaymsg();

	}

	/** 神力加持展示 */
	public void Strength(String name, String msg) {
		box.removemsg();
		box.addText("#cf8fc70" + name, 310, UIUtils.TEXT_FONT5);
		box.addText(msg, 310, UIUtils.TEXT_FONT1);
		boxw = 320;// 宽
		boxh = box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(boxw, boxh));
		boxx = (int) goodx.getX();
		boxy = (int) goodx.getY();
		displaymsg();
	}

	/**
	 * 神力加持展示替换
	 *
	 * @param remark
	 * @param skillAll
	 * @param level
	 * @return
	 */
	public static String StrengthChange(String remark, Skill skillAll, double level) {
		remark = remark.replace("{公式一}", Arith.mul(Double.parseDouble(skillAll.getGrow()), level) + "");
		return remark;
	}

	// 显示提示框
	public void displaymsg() {
		MsgJframe.getJframe().setBounds(boxx, boxy, boxw, boxh);
		FormsManagement.showForm(46);
	}

	public ChatBox getBox() {
		return box;
	}

	public void setBox(ChatBox box) {
		this.box = box;
	}

	public void FM(String name, String msg) {
		this.box.removemsg();
		this.box.addText("#cf8fc70" + name, 310, UIUtils.TEXT_FONT5);
		this.box.addText("#G" + msg, 310, UIUtils.TEXT_FONT1);
		this.boxw = 320;
		this.boxh = this.box.getHeight();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(this.boxw, this.boxh));
		this.boxx = ((int) goodx.getX());
		this.boxy = ((int) goodx.getY());
		displaymsg();
	}

	public void texiao2(int x,int y,String type) {
		if (tx != null) {
			return;
		}
		Sprite mouse = SpriteFactory.Prepare(GetTcpPath.getMouseTcp(type));
		if (mouse != null) {
			time = 0;
			tx = mouse;
			boxw = ScrenceUntil.Screen_x;
			boxh = ScrenceUntil.Screen_y;
			boxx = x;
			boxy = y;
			displaymsg();
		}
	}

	public void skillmsg(final Skill skill) {
		this.box.removemsg();
		this.box.removemsg();
		if (Integer.parseInt(skill.getSkillid()) < 1100) {
			this.SM(skill, 1.0, 200);
		}
		else {
			String msg = skill.getRemark();
			final double sv = Double.parseDouble(skill.getGrow());
			final long qm = UserMessUntil.getChosePetMes().getFriendliness().longValue();
			final double value = Double.parseDouble(skill.getValue());
			if (skill.getSkillid().equals("1237")) {
				msg = msg.replace((CharSequence)"{0}", (CharSequence)String.format("%.2f", Double.valueOf(value + CustomFunction.XS(qm, sv))));
				msg = msg.replace((CharSequence)"{1}", (CharSequence)String.format("%.2f", Double.valueOf(25.0 + CustomFunction.XS(qm, sv))));
			}
			else {
				if (skill.getSkillid().equals("1238") || skill.getSkillid().equals("1240")) {
					msg = msg.replace((CharSequence)"{0}", (CharSequence)String.format("%.2f", Double.valueOf(value + CustomFunction.XS(qm, sv))));
					msg = msg.replace((CharSequence)"{1}", (CharSequence)String.format("%.2f", Double.valueOf(Double.parseDouble(skill.getValue1()) + CustomFunction.XS(qm, Double.parseDouble(skill.getGrow1())))));
				}
				else {
					if (skill.getSkillid().equals("1241")) {
						msg = msg.replace((CharSequence)"{0}", (CharSequence)String.format("%.2f", Double.valueOf(value + CustomFunction.XS(qm, sv))));
					}
					else {
						if (skill.getSkillid().equals("1216")) {
							msg = msg.replace((CharSequence)"{0}", (CharSequence)"2");
							msg = msg.replace((CharSequence)"{1}", (CharSequence)String.format("%.0f", Double.valueOf(value + CustomFunction.XS(qm, sv))));
							msg = msg.replace((CharSequence)"{2}", (CharSequence)String.format("10", Double.valueOf(value + CustomFunction.XS(qm, sv))));
						}
						else {
							if (skill.getSkillid().equals("1256")) {
								msg = msg.replace((CharSequence)"{0}", (CharSequence)("#R" + String.format("%.1f", Double.valueOf(value + CustomFunction.XS(qm, sv))) + "#G"));
								msg = msg.replace((CharSequence)"{1}", (CharSequence)("#R" + String.format("%.1f", Double.valueOf(value + CustomFunction.XS(qm, sv))) + "#G"));
							}
							else {
								if (skill.getSkillid().equals("1257")) {
									msg = msg.replace((CharSequence)"{0}", (CharSequence)("#R" + String.format(value + (double)(int)CustomFunction.XS(qm, sv) + "#G", new Object[0])));
								}
								else {
									if (skill.getSkillid().equals("1255")) {
										msg = msg.replace((CharSequence)"{0}", (CharSequence)("#R" + String.format("%.1f", Double.valueOf(value + CustomFunction.XS(qm, sv))) + "#G"));
										msg = msg.replace((CharSequence)"{1}", (CharSequence)("#R" + String.format("%.1f", Double.valueOf(value + CustomFunction.XS(qm, sv))) + "#G"));
										msg = msg.replace((CharSequence)"{2}", (CharSequence)("#R" + String.format("%.1f", Double.valueOf(value + CustomFunction.XS(qm, sv))) + "#G"));
									}
									else {
										if (skill.getSkillid().equals("1259")) {
											msg = msg.replace((CharSequence)"{0}", (CharSequence)("#R" + String.format("%.1f", Double.valueOf(value + CustomFunction.XS(qm, sv))) + "#G"));
											msg = msg.replace((CharSequence)"{1}", (CharSequence)("#R" + String.format("%.1f", Double.valueOf(value + CustomFunction.XS(qm, sv))) + "#G"));
										}else {
											int skillid= Integer.parseInt(skill.getSkillid());
											if (skillid>=4000&&skillid<=4045){
												if (skillid>=4023){
													if (msg.contains("{守护石1}")){
														msg = msg.replace((CharSequence)"{守护石1}", (CharSequence)("#R" + String.format("%.1f", listMap.get(skillid-23).get(0)/30) + "%#G"));
													}
													if (msg.contains("{守护石2}")){
														msg = msg.replace((CharSequence)"{守护石2}", (CharSequence)("#R" + String.format("%.1f", listMap.get(skillid-23).get(1)/30) + "%#G"));
													}
												}else {
													if (msg.contains("{守护石1}")){
														msg = msg.replace((CharSequence)"{守护石1}", (CharSequence)("#R" + String.format("%.1f", listMap.get(skillid).get(0)/15) + "%#G"));
													}
													if (msg.contains("{守护石2}")){
														msg = msg.replace((CharSequence)"{守护石2}", (CharSequence)("#R" + String.format("%.1f", listMap.get(skillid).get(1)/15) + "%#G"));
													}
												}


											}
										}
									}
								}
							}
						}
					}
				}
			}
			final String[] v = PetSkillsJpanel.StringReplace(msg).split("\\|");
			int i = 0;
			while (i < v.length) {
				final String[] v2 = v[i].split("=");
				if (skill.getSkilltype().equals("4") && v2[1].equals("0/999")) {
					v2[1] = UserMessUntil.getChosePetMes().getTrainNum() + "/999";
				}
				final String vg;
				if ((vg = this.gongshi(v, i)) != null) {
					this.box.addText("#c" + v2[0] + " " + v2[1] + "#c" + v[++i].split("=")[0] + vg + "#r", 320);
				}
				else {
					this.box.addText("#c" + v2[0] + " " + v2[1] + "#r", 320);
				}
				++i;
			}
			this.boxw = 320;
			this.boxh = ScrenceUntil.Screen_y;
			final Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(), new Dimension(this.boxw, this.boxh));
			this.boxx = (int)goodx.getX() + 8;
			this.boxy = (int)goodx.getY() + 350;
			this.displaymsg();
		}
	}

	public String gongshi(final String[] v, final int i) {
		if (v.length > i + 1) {
			final String[] vs = v[i + 1].split("=");
			if (vs.length > 1 && (vs[1].equals("{公式一}") || vs[1].equals("{公式二}") || vs[1].equals("{公式三}") || vs[1].equals("{公式四}") || vs[1].equals("{公式五}"))) {
				return "1";
			}
		}
		return null;
	}

	private ImageIcon points = new ImageIcon("inkImg/old/background/S412.png");
	private Boolean pointFlag = false;


	public void showXFD2(String head,String text,int x, int y, int xyNum, String name) {
		box.removemsg();
		pointFlag = true;
		box.imageUpdate(points.getImage(), 1, 10, 10, 20, 20);

		box.addText("" , 320, UIUtils.TEXT_FONT6);
		box.addText("    #cCDCDB4  " + name, 320, UIUtils.TEXT_FONTYH20);
		box.addText("#Y --------------", 320);
		box.addText("#cC5C583  " + head, 320, UIUtils.TEXT_FONT221);
		box.addText("#Y ----------------------------------------", 320);
		box.addText(" #cC5C583  " + text ,310, UIUtils.TEXT_MSG);
		box.addText("   " ,320, UIUtils.TEXT_MSG);
		box.addText("#R  需要"+xyNum+"点总心意点" ,320, UIUtils.TEXT_MSG);

		boxw = box.getWidth();
		boxh = box.getHeight();
		boxx = x - box.getWidth() / 2;
		boxy = y - 35;
		displaymsg();
	}
	public void showXFD29(String text, int x, int y) {
		box.removemsg();
		box.addText("#Y" + text + "   ", 300);
		boxh = box.getHeight();
		boxw = box.getWidth();
		Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(),
				new Dimension(boxw, boxh));
		boxx = x - box.getWidth() / 2;
		boxy = y - 35;
		displaymsg();

	}
	static   Map<Integer,List<Double>>listMap=new HashMap<>();
	static {
		List<Double> list = new ArrayList<>();
		list.add(30.0);
		listMap.put(4000, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(15.0);
		listMap.put(4001, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(6.0);
		listMap.put(4002, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(4.5);
		list.add(3000.0);
		listMap.put(4003, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(60.0);
		list.add(60.0);
		listMap.put(4004, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(30.0);
		list.add(45.0);
		listMap.put(4005, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(105.0);
		list.add(30.0);
		listMap.put(4006, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(45.0);
		listMap.put(4007, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(15.0);
		listMap.put(4008, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(24.0);
		listMap.put(4009, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(45.0);
		list.add(15.0);
		listMap.put(4010, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(45.0);
		list.add(16.0);
		listMap.put(4011, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(75.0);
		list.add(15.0);
		listMap.put(4012, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(3.0);
		listMap.put(4013, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(60.0);
		list.add(15.0);
		listMap.put(4014, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(60.0);
		list.add(15.0);
		listMap.put(4015, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(22.5);
		listMap.put(4016, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(75.0);
		list.add(15.0);
		listMap.put(4017, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(75.0);
		listMap.put(4018, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(45.0);
		list.add(30.0);
		listMap.put(4019, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(45.0);
		list.add(30.0);
		listMap.put(4020, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(60.0);
		list.add(30.0);
		listMap.put(4021, new ArrayList<>(list));

		list = new ArrayList<>();
		list.add(9.0);
		list.add(9.0);
		listMap.put(4022, new ArrayList<>(list));


	}
}
